package com.yunhe.sms.service.system.impl;

import com.yunhe.commens.dto.Pagedao;
import com.yunhe.sms.dao.system.UserDao;
import com.yunhe.sms.dao.system.impl.UserDaoImpl;
import com.yunhe.sms.entity.system.User;
import com.yunhe.sms.service.system.UserService;

import java.util.List;

/**
 * @author LeiPeifeng
 * @version V1.0
 * @date 2017/10/25 0025 11:46
 * @Description: 实现UserService 接口
 */
public class UserServiceImpl implements UserService {
    private UserDao userDao =new UserDaoImpl ();
    @Override
    public void save(User user) {
        userDao.save ( user );

    }

    @Override
    public void update(User user) {
        userDao.update ( user );
    }

    @Override
    public void updatepwd(String password,String name) {
        userDao.updatepwd ( password,name );
    }

    @Override
    public void deleted(String ids) {
        String[] split = ids.split ( "," );
        for (String id : split){
            userDao.deleted ( new Long(id) );
        }
    }

    @Override
    public List<User> findList() {
        return userDao.findList ();
    }

    @Override
    public User findOne(Long id) {
        return userDao.findOne ( id );
    }

    @Override
    public Pagedao<User> findPage(int offset, int size) {
        return userDao.findPage ( offset,size );
    }



    @Override
    public User user(String name) {
        User user = userDao.verifyname ( name );
        return user;
    }
}
